package gagak.framework.web.view;

import com.fasterxml.jackson.databind.ser.FilterProvider;
import gagak.framework.web.annonation.Nullable;

/*
 *
 */
public class MappingJacksonValue {

    private Object value;

    @Nullable
    private Class<?> serializationView;

    @Nullable
    private FilterProvider filters;

    @Nullable
    private String jsonpFunction;


    /*
     *
     * @param value the Object to be serialized
     */
    public MappingJacksonValue(Object value) {
        this.value = value;
    }


    /*
     * Modify the POJO to serialize.
     */
    public void setValue(Object value) {
        this.value = value;
    }

    /*
     * Return the POJO that needs to be serialized.
     */
    public Object getValue() {
        return this.value;
    }

    /*
     * @see com.fasterxml.jackson.databind.ObjectMapper#writerWithView(Class)
     * @see com.fasterxml.jackson.annotation.JsonView
     */
    public void setSerializationView(@Nullable Class<?> serializationView) {
        this.serializationView = serializationView;
    }

    /*
     * @see com.fasterxml.jackson.databind.ObjectMapper#writerWithView(Class)
     * @see com.fasterxml.jackson.annotation.JsonView
     */
    @Nullable
    public Class<?> getSerializationView() {
        return this.serializationView;
    }

    /*
     * @see com.fasterxml.jackson.databind.ObjectMapper#writer(FilterProvider)
     * @see com.fasterxml.jackson.annotation.JsonFilter
     */
    public void setFilters(@Nullable FilterProvider filters) {
        this.filters = filters;
    }

    /*
     *
     * @see com.fasterxml.jackson.databind.ObjectMapper#writer(FilterProvider)
     * @see com.fasterxml.jackson.annotation.JsonFilter
     */
    @Nullable
    public FilterProvider getFilters() {
        return this.filters;
    }

    /*
     */
    @Deprecated
    public void setJsonpFunction(@Nullable String functionName) {
        this.jsonpFunction = functionName;
    }

    /*
     */
    @Deprecated
    @Nullable
    public String getJsonpFunction() {
        return this.jsonpFunction;
    }

}
